package com.study.model.pojo;

import java.io.Serializable;
import javax.persistence.*;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonManagedReference;

import java.util.Date;
import java.util.List;

/**
 * The persistent class for the users database table.
 * 
 */
@Entity
@Table(name = "users")
@NamedQuery(name = "User.findAll", query = "SELECT u FROM User u")
public class User implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "use_id")
	private int useId;

	@Column(name = "us_phone")
	private String usPhone;

	@Column(name = "use_age")
	private int useAge;
	
	@Column(name = "use_name")
	private String useName;
	
	@Column(name = "login_name")
	private String loginName;

	@Column(name = "use_password")
	private String usePassword;

	@Column(name = "use_sex")
	private int useSex;
	
	@Column(name="use_img")
	private String useimg;

	@Temporal(TemporalType.DATE)
	@Column(name = "use_timein")
	private Date useTimein;
	

	// bi-directional many-to-one association to Backlog
	@OneToMany(mappedBy = "user")
	private List<Backlog> backlogs;

	// bi-directional many-to-one association to Care
	@OneToMany(mappedBy = "user")
	private List<Care> cares;

	// bi-directional many-to-one association to Colle
	@OneToMany(mappedBy = "user")
	private List<Colle> colles;

	// bi-directional many-to-one association to Complaint
	@OneToMany(mappedBy = "user")
	private List<Complaint> complaints;

	// bi-directional many-to-one association to Cusmshift
	@OneToMany(mappedBy = "user1")
	private List<Cusmshift> cusmshifts1;

	// bi-directional many-to-one association to Cusmshift
	@OneToMany(mappedBy = "user2")
	private List<Cusmshift> cusmshifts2;

	// bi-directional many-to-one association to Cusmshift
	@OneToMany(mappedBy = "user3")
	private List<Cusmshift> cusmshifts3;

	// bi-directional many-to-one association to Customer
	@OneToMany(mappedBy = "user")
	private List<Customer> customers;

	// bi-directional many-to-one association to Customerconsolidation
	@OneToMany(mappedBy = "user1")
	private List<Customerconsolidation> customerconsolidations1;

	// bi-directional many-to-one association to Customerconsolidation
	@OneToMany(mappedBy = "user2")
	private List<Customerconsolidation> customerconsolidations2;

	// bi-directional many-to-one association to Customerconsolidation
	@OneToMany(mappedBy = "user3")
	private List<Customerconsolidation> customerconsolidations3;

	// bi-directional many-to-one association to Deliveryschedule
	@OneToMany(mappedBy = "user")
	private List<Deliveryschedule> deliveryschedules;

	// bi-directional many-to-many association to Dept
	@ManyToMany(mappedBy = "users1")
	private List<Dept> depts1;

	// bi-directional many-to-one association to FormsDetail
	@OneToMany(mappedBy = "user")
	private List<FormsDetail> formsDetails;

	// bi-directional many-to-one association to Offer
	@OneToMany(mappedBy = "user")
	private List<Offer> offers;

	// bi-directional many-to-one association to Offersdetail
	@OneToMany(mappedBy = "user")
	private List<Offersdetail> offersdetails;

	// bi-directional many-to-one association to Opportunity
	@OneToMany(mappedBy = "user")
	private List<Opportunity> opportunitys;

	// bi-directional many-to-one association to Orderform
	@OneToMany(mappedBy = "user")
	private List<Orderform> orderforms;

	// bi-directional many-to-one association to Repairlist
	@OneToMany(mappedBy = "user")
	private List<Repairlist> repairlists;

	// bi-directional many-to-one association to Returne
	@OneToMany(mappedBy = "user")
	private List<Returne> returnes;

	// bi-directional many-to-many association to Role
	@ManyToMany(mappedBy = "users")
	private List<Role> roles;

	// bi-directional many-to-one association to Service
	@OneToMany(mappedBy = "user")
	private List<Service> services;
	
	// bi-directional many-to-one association to Service
	@OneToMany(mappedBy = "user")
	private List<Logforcust> logforcust;

	// bi-directional many-to-many association to Dept
	@ManyToMany
	@JoinTable(name = "usersdept", joinColumns = { @JoinColumn(name = "use_id") }, inverseJoinColumns = {
			@JoinColumn(name = "dep_id") })
	private List<Dept> depts2;

	public User() {
	}
	
	

	public String getUseimg() {
		return useimg;
	}



	public void setUseimg(String useimg) {
		this.useimg = useimg;
	}



	public int getUseId() {
		return this.useId;
	}

	public void setUseId(int useId) {
		this.useId = useId;
	}

	public String getUsPhone() {
		return this.usPhone;
	}

	public void setUsPhone(String usPhone) {
		this.usPhone = usPhone;
	}

	public int getUseAge() {
		return this.useAge;
	}

	public void setUseAge(int useAge) {
		this.useAge = useAge;
	}

	public String getUseName() {
		return this.useName;
	}

	public void setUseName(String useName) {
		this.useName = useName;
	}

	public String getUsePassword() {
		return this.usePassword;
	}

	public void setUsePassword(String usePassword) {
		this.usePassword = usePassword;
	}

	public int getUseSex() {
		return this.useSex;
	}

	public void setUseSex(int useSex) {
		this.useSex = useSex;
	}

	public Date getUseTimein() {
		return this.useTimein;
	}

	public void setUseTimein(Date useTimein) {
		this.useTimein = useTimein;
	}

	public List<Backlog> getBacklogs() {
		return this.backlogs;
	}

	public void setBacklogs(List<Backlog> backlogs) {
		this.backlogs = backlogs;
	}

	public Backlog addBacklog(Backlog backlog) {
		getBacklogs().add(backlog);
		backlog.setUser(this);

		return backlog;
	}

	public Backlog removeBacklog(Backlog backlog) {
		getBacklogs().remove(backlog);
		backlog.setUser(null);

		return backlog;
	}

	public List<Care> getCares() {
		return this.cares;
	}

	public void setCares(List<Care> cares) {
		this.cares = cares;
	}

	public Care addCare(Care care) {
		getCares().add(care);
		care.setUser(this);

		return care;
	}

	public Care removeCare(Care care) {
		getCares().remove(care);
		care.setUser(null);

		return care;
	}

	public List<Colle> getColles() {
		return this.colles;
	}

	public void setColles(List<Colle> colles) {
		this.colles = colles;
	}

	public Colle addColle(Colle colle) {
		getColles().add(colle);
		colle.setUser(this);

		return colle;
	}

	public Colle removeColle(Colle colle) {
		getColles().remove(colle);
		colle.setUser(null);

		return colle;
	}

	public List<Complaint> getComplaints() {
		return this.complaints;
	}

	public void setComplaints(List<Complaint> complaints) {
		this.complaints = complaints;
	}

	public Complaint addComplaint(Complaint complaint) {
		getComplaints().add(complaint);
		complaint.setUser(this);

		return complaint;
	}

	public Complaint removeComplaint(Complaint complaint) {
		getComplaints().remove(complaint);
		complaint.setUser(null);

		return complaint;
	}

	public List<Cusmshift> getCusmshifts1() {
		return this.cusmshifts1;
	}

	public void setCusmshifts1(List<Cusmshift> cusmshifts1) {
		this.cusmshifts1 = cusmshifts1;
	}

	public Cusmshift addCusmshifts1(Cusmshift cusmshifts1) {
		getCusmshifts1().add(cusmshifts1);
		cusmshifts1.setUser1(this);

		return cusmshifts1;
	}

	public Cusmshift removeCusmshifts1(Cusmshift cusmshifts1) {
		getCusmshifts1().remove(cusmshifts1);
		cusmshifts1.setUser1(null);

		return cusmshifts1;
	}

	public List<Cusmshift> getCusmshifts2() {
		return this.cusmshifts2;
	}

	public void setCusmshifts2(List<Cusmshift> cusmshifts2) {
		this.cusmshifts2 = cusmshifts2;
	}

	public Cusmshift addCusmshifts2(Cusmshift cusmshifts2) {
		getCusmshifts2().add(cusmshifts2);
		cusmshifts2.setUser2(this);

		return cusmshifts2;
	}

	public Cusmshift removeCusmshifts2(Cusmshift cusmshifts2) {
		getCusmshifts2().remove(cusmshifts2);
		cusmshifts2.setUser2(null);

		return cusmshifts2;
	}

	public List<Cusmshift> getCusmshifts3() {
		return this.cusmshifts3;
	}

	public void setCusmshifts3(List<Cusmshift> cusmshifts3) {
		this.cusmshifts3 = cusmshifts3;
	}

	public Cusmshift addCusmshifts3(Cusmshift cusmshifts3) {
		getCusmshifts3().add(cusmshifts3);
		cusmshifts3.setUser3(this);

		return cusmshifts3;
	}

	public Cusmshift removeCusmshifts3(Cusmshift cusmshifts3) {
		getCusmshifts3().remove(cusmshifts3);
		cusmshifts3.setUser3(null);

		return cusmshifts3;
	}

	public List<Customer> getCustomers() {
		return this.customers;
	}

	public void setCustomers(List<Customer> customers) {
		this.customers = customers;
	}

	public Customer addCustomer(Customer customer) {
		getCustomers().add(customer);
		customer.setUser(this);

		return customer;
	}

	public Customer removeCustomer(Customer customer) {
		getCustomers().remove(customer);
		customer.setUser(null);

		return customer;
	}

	public List<Customerconsolidation> getCustomerconsolidations1() {
		return this.customerconsolidations1;
	}

	public void setCustomerconsolidations1(List<Customerconsolidation> customerconsolidations1) {
		this.customerconsolidations1 = customerconsolidations1;
	}

	public Customerconsolidation addCustomerconsolidations1(Customerconsolidation customerconsolidations1) {
		getCustomerconsolidations1().add(customerconsolidations1);
		customerconsolidations1.setUser1(this);

		return customerconsolidations1;
	}

	public Customerconsolidation removeCustomerconsolidations1(Customerconsolidation customerconsolidations1) {
		getCustomerconsolidations1().remove(customerconsolidations1);
		customerconsolidations1.setUser1(null);

		return customerconsolidations1;
	}

	public List<Customerconsolidation> getCustomerconsolidations2() {
		return this.customerconsolidations2;
	}

	public void setCustomerconsolidations2(List<Customerconsolidation> customerconsolidations2) {
		this.customerconsolidations2 = customerconsolidations2;
	}

	public Customerconsolidation addCustomerconsolidations2(Customerconsolidation customerconsolidations2) {
		getCustomerconsolidations2().add(customerconsolidations2);
		customerconsolidations2.setUser2(this);

		return customerconsolidations2;
	}

	public Customerconsolidation removeCustomerconsolidations2(Customerconsolidation customerconsolidations2) {
		getCustomerconsolidations2().remove(customerconsolidations2);
		customerconsolidations2.setUser2(null);

		return customerconsolidations2;
	}

	public List<Customerconsolidation> getCustomerconsolidations3() {
		return this.customerconsolidations3;
	}

	public void setCustomerconsolidations3(List<Customerconsolidation> customerconsolidations3) {
		this.customerconsolidations3 = customerconsolidations3;
	}

	public Customerconsolidation addCustomerconsolidations3(Customerconsolidation customerconsolidations3) {
		getCustomerconsolidations3().add(customerconsolidations3);
		customerconsolidations3.setUser3(this);

		return customerconsolidations3;
	}

	public Customerconsolidation removeCustomerconsolidations3(Customerconsolidation customerconsolidations3) {
		getCustomerconsolidations3().remove(customerconsolidations3);
		customerconsolidations3.setUser3(null);

		return customerconsolidations3;
	}

	public List<Deliveryschedule> getDeliveryschedules() {
		return this.deliveryschedules;
	}

	public void setDeliveryschedules(List<Deliveryschedule> deliveryschedules) {
		this.deliveryschedules = deliveryschedules;
	}

	public Deliveryschedule addDeliveryschedule(Deliveryschedule deliveryschedule) {
		getDeliveryschedules().add(deliveryschedule);
		deliveryschedule.setUser(this);

		return deliveryschedule;
	}

	public Deliveryschedule removeDeliveryschedule(Deliveryschedule deliveryschedule) {
		getDeliveryschedules().remove(deliveryschedule);
		deliveryschedule.setUser(null);

		return deliveryschedule;
	}

	public List<Dept> getDepts1() {
		return this.depts1;
	}

	public void setDepts1(List<Dept> depts1) {
		this.depts1 = depts1;
	}

	public List<FormsDetail> getFormsDetails() {
		return this.formsDetails;
	}

	public void setFormsDetails(List<FormsDetail> formsDetails) {
		this.formsDetails = formsDetails;
	}

	public FormsDetail addFormsDetail(FormsDetail formsDetail) {
		getFormsDetails().add(formsDetail);
		formsDetail.setUser(this);

		return formsDetail;
	}

	public FormsDetail removeFormsDetail(FormsDetail formsDetail) {
		getFormsDetails().remove(formsDetail);
		formsDetail.setUser(null);

		return formsDetail;
	}

	public List<Offer> getOffers() {
		return this.offers;
	}

	public void setOffers(List<Offer> offers) {
		this.offers = offers;
	}

	public Offer addOffer(Offer offer) {
		getOffers().add(offer);
		offer.setUser(this);

		return offer;
	}

	public Offer removeOffer(Offer offer) {
		getOffers().remove(offer);
		offer.setUser(null);

		return offer;
	}

	public List<Offersdetail> getOffersdetails() {
		return this.offersdetails;
	}

	public void setOffersdetails(List<Offersdetail> offersdetails) {
		this.offersdetails = offersdetails;
	}

	public Offersdetail addOffersdetail(Offersdetail offersdetail) {
		getOffersdetails().add(offersdetail);
		offersdetail.setUser(this);

		return offersdetail;
	}

	public Offersdetail removeOffersdetail(Offersdetail offersdetail) {
		getOffersdetails().remove(offersdetail);
		offersdetail.setUser(null);

		return offersdetail;
	}

	public List<Opportunity> getOpportunitys() {
		return this.opportunitys;
	}

	public void setOpportunitys(List<Opportunity> opportunitys) {
		this.opportunitys = opportunitys;
	}

	public Opportunity addOpportunity(Opportunity opportunity) {
		getOpportunitys().add(opportunity);
		opportunity.setUser(this);

		return opportunity;
	}

	public Opportunity removeOpportunity(Opportunity opportunity) {
		getOpportunitys().remove(opportunity);
		opportunity.setUser(null);

		return opportunity;
	}

	public List<Orderform> getOrderforms() {
		return this.orderforms;
	}

	public void setOrderforms(List<Orderform> orderforms) {
		this.orderforms = orderforms;
	}

	public Orderform addOrderform(Orderform orderform) {
		getOrderforms().add(orderform);
		orderform.setUser(this);

		return orderform;
	}

	public Orderform removeOrderform(Orderform orderform) {
		getOrderforms().remove(orderform);
		orderform.setUser(null);

		return orderform;
	}

	public List<Repairlist> getRepairlists() {
		return this.repairlists;
	}

	public void setRepairlists(List<Repairlist> repairlists) {
		this.repairlists = repairlists;
	}

	public Repairlist addRepairlist(Repairlist repairlist) {
		getRepairlists().add(repairlist);
		repairlist.setUser(this);

		return repairlist;
	}

	public Repairlist removeRepairlist(Repairlist repairlist) {
		getRepairlists().remove(repairlist);
		repairlist.setUser(null);

		return repairlist;
	}

	public List<Returne> getReturnes() {
		return this.returnes;
	}

	public void setReturnes(List<Returne> returnes) {
		this.returnes = returnes;
	}

	public Returne addReturne(Returne returne) {
		getReturnes().add(returne);
		returne.setUser(this);

		return returne;
	}

	public Returne removeReturne(Returne returne) {
		getReturnes().remove(returne);
		returne.setUser(null);

		return returne;
	}

	public List<Role> getRoles() {
		return this.roles;
	}

	public void setRoles(List<Role> roles) {
		this.roles = roles;
	}

	public List<Service> getServices() {
		return this.services;
	}

	public void setServices(List<Service> services) {
		this.services = services;
	}

	public Service addService(Service service) {
		getServices().add(service);
		service.setUser(this);

		return service;
	}

	public Service removeService(Service service) {
		getServices().remove(service);
		service.setUser(null);

		return service;
	}

	public List<Dept> getDepts2() {
		return this.depts2;
	}

	public void setDepts2(List<Dept> depts2) {
		this.depts2 = depts2;
	}

	public String getLoginName() {
		return loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	public List<Logforcust> getLogforcust() {
		return logforcust;
	}

	public void setLogforcust(List<Logforcust> logforcust) {
		this.logforcust = logforcust;
	}
	
	public Logforcust addLogforcust(Logforcust logforcust) {
		getLogforcust().add(logforcust);
		logforcust.setUser(this);

		return logforcust;
	}

	public Logforcust removeLogforcust(Logforcust logforcust) {
		getLogforcust().remove(logforcust);
		logforcust.setUser(null);

		return logforcust;
	}
}